{% extends 'base.html' %}
{% load static app_extras %}
{% block title %}登录{% endblock title %}

{% block extra_style %}
  <link rel="stylesheet" type="text/css" href="{% static 'css/login.css' %}">
{% endblock extra_style %}

{% block content %}
<form id="login-form" class="form-horizontal" action="" method="post">
  {% csrf_token %}
  <div class="form-group">
    {% with form.username as field %}
      <label for="{{ field.id_for_label }}" class="col-sm-2 control-label">{{ field.label }}</label>
      <div class="col-sm-10">
        <input type="email" id="{{ field.id_for_label }}" name="{{ field.html_name }}" class="form-control" value="{{ field.value }}" placeholder="OA账户名">
        {{ field.errors }}
      </div>
    {% endwith %}
  </div>
  <div class="form-group">
    {% with form.password as field %}
      <label for="{{ field.id_for_label }}" class="col-sm-2 control-label">{{ field.label }}</label>
      <div class="col-sm-10">
        <input type="password" id="{{ field.id_for_label }}" name="{{ field.html_name }}" class="form-control" value="{{ field.value }}" placeholder="OA密码">
        {{ field.errors }}
      </div>
    {% endwith %}
  </div>
  <p>{{ form.non_field_errors }}</p>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <div class="checkbox">
        {% with form.remember as field %}
          <label>
            {{ field }}下次自动登录
          </label>
        {% endwith %}
      </div>
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default">登录</button>
    </div>
  </div>
</form>
{% endblock content%}
{% block extra_script %}
  <script src="{% static 'js/login.js' %}"></script>
{% endblock extra_script %}
